Currently, as definition of digital video and digital image becomes higher and higher and rate of digital video becomes higher and higher, amount of data to be processed in a digital video/image processing system is becoming larger and larger, and capacity and bandwidth of a memory for storing video/image to be processed and the processed video/image are becoming larger and larger.
Inserting an embedded compressor (i.e., an embedded codec) between a function module (i.e., a video/image processing system) and an on-chip/external memory module is effective in reducing the requirement on the capacity and bandwidth of the memory. Image data to be processed is firstly compressed by the embedded compressor before being transmitted to the memory, and the compressed image data is firstly decompressed by the embedded compressor before being processed by the function module.
Most existing embedded image compression algorithms perform image compression with a fixed compression ratio, and fail to set compression ratios according to various image sizes or applications. Generally, for a high-definition image, it is necessary to perform compression with a high compression ratio; and for a comparative low-definition image, it is enough to perform compression with a lower compression ratio. Further, the compression ratio will influence the quality of a reconstructed image. The lower the compression ratio is, the higher quality of the reconstructed image obtained from decompression would be.
In the image processing system, in order to save the bandwidth and the memory, each request desires to request for useful data only with redundant data reduced to the minimum, which requires compressed data to be capable of being accessed randomly and compression ratio of each compression unit be fixed. In an image, simple and smooth regions are easy to be compressed, a very high compression ratio can be reached, and there would be a lot of redundant bits appearing in the case that the unit length is fixed; complex regions are not easy to be compressed and image quality drops significantly in the case that the unit length is fixed. Therefore, employing a fixed compression ratio for one image cannot improve the compression ratio; instead, it will cause loss in image quality.
The invention distinguishes compression units from accessing units, realizes random access while guaranteeing compression ratio and image quality, and thus reduces cost on the bandwidth and the memory.